package cn.tedu.spring.resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class WeiboMapper {
    /*
        Resource注解：注入对象或接口类型的数据;
        装配规则如下:
          1.根据IoC容器中 Spring Bean对象名称进行装配[name参数];
          2.未指定name参数,则会把属性名作为Bean对象名称进行装配;
          3.属性名和Bean对象名称不一致,则根据类型进行装配;

        面试题:Autowired注解和Resource注解的区别;
          * Autowired注解是Spring Framework注解,Resource注解是JDK注解;
          * 装配规则:
            1.Autowired注解是根据类型进行装配,如果需要根据名称进行装配,需要结合@Qualifier注解使用;
            2.Resource注解[见上面]
     */
    //@Resource(name = "resMapperImpl1")
    @Resource(name = "resMapperImpl1")
    private ResMapper resMapper;
}
